//package com.yang.command;
//
//import com.mojang.authlib.GameProfile;
//import com.yang.CitizensNPC;
//import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
//import net.minecraft.server.MinecraftServer;
//import net.minecraft.server.level.EntityPlayer;
//import org.bukkit.command.Command;
//import org.bukkit.command.CommandExecutor;
//import org.bukkit.command.CommandSender;
//import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
//import org.bukkit.entity.Player;
//
//import java.util.UUID;
//
//public class CreateNPC implements CommandExecutor {
//    private static CitizensNPC citizensNPC;
//
//    public CreateNPC(CitizensNPC citizensNPC) {
//        this.citizensNPC = citizensNPC;
//    }
//
//    @Override
//    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
//        //执行指令
//        if(!label.equalsIgnoreCase("createNpc")){
//            return true;
//        }
//        if (args.length == 0){
//            return true;
//        }
//        // 判断是否是玩家执行
//        if (!(sender instanceof Player)) {
//            return true;
//        }
//        Player player = (Player) sender;
//
//        CraftPlayer craftPlayer = (CraftPlayer) player;
//        ServerPlayer sp = craftPlayer.getHandle();
//        MinecraftServer server = sp.getServer();
//        ServerLevel leve = sp.getLevel();
//        GameProfile gameProfile = new GameProfile(UUID.randomUUID(),"name");
//
//        ServerPlayer npc = new ServerPlayer(server,leve,gameProfile);
//        EntityPlayer npc = new EntityPlayer(server, leve,gameProfile);
//
//        ServerGameProfileListenerImpl ps = sp.connection;
//        //PlayerInfoPacket
//        ps.send(new ClientboundPlayerInfoUpdatePacket(Action))
//        //Spawn Packet
//
//
//
//        citizensNPC.spawnNPC((Player) sender);
//
//        return true;
//    }
//}
